#include <chrono>
#include <ctime>
#include <iostream>
#include <ratio>
#include <unistd.h> //sleep、usleep

int main() {
  using namespace std::chrono;

  steady_clock::time_point t1 = steady_clock::now();

  for (int i = 0; i < 1000; ++i)
    usleep(10);
  std::cout << "休息10us × 1000\n";

  steady_clock::time_point t2 = steady_clock::now();

  duration<double> time_span = duration_cast<duration<double>>(t2 - t1);

  std::cout << "消耗时间： " << time_span.count() << " seconds.";
  std::cout << std::endl;

  return 0;
}
